<template>
  <el-row>
    <el-col :span="($attrs.note ? 4 : 24)">
      <el-select v-bind="$attrs" v-on="$listeners" v-model="fieldValue" @keyup.native.13.stop>
        <el-option v-for="(item, index) in options"
                  :key="index"
                  :label="item.label"
                  :value="item.value">
        </el-option>
      </el-select>
    </el-col>
    <el-col v-if="$attrs.note" :span="16">
      <div  style="height:40px;line-height:40px;color:red;padding:0px 10px;">
        {{$attrs.note}}
      </div>
    </el-col>
  </el-row>
</template>

<script>
  export default {
    props: {
      value: {
        type: [String, Number, Boolean, Array],
        default:''
      },
      options: {
        type: Array,
        default() {
          return []
        }
      }
    },
    computed: {
      fieldValue: {
        get() {
          return (this.value || this.value == 0) ? String(this.value) : '';
        },
        set(val) {
          this.$emit('input', val)
        }
      }
    }
  }
</script>

